<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">




<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
  </script>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />



  <link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico?v=5.1.4">







  <meta name="keywords" content="Swift," />





  <link rel="alternate" href="/atom.xml" title="Swift社区" type="application/atom+xml" />






<meta name="description" content="前言本期是 Swift 编辑组自主整理周报的第八期，每个模块已初步成型。各位读者如果有好的提议，欢迎在文末留言。 欢迎投稿或推荐内容。目前计划每两周周一发布，欢迎志同道合的朋友一起加入周报整理。 风起雨坠袭大地，叶落冬来又一年。Swift社区，和你同风雨，与你共未来！👊👊👊  周报精选 新闻和社区：苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。 提案：">
<meta name="keywords" content="Swift">
<meta property="og:type" content="article">
<meta property="og:title" content="Swift 周报 第十七期">
<meta property="og:url" content="https://fanbaoying.github.io/Swift-周报-第十七期/index.html">
<meta property="og:site_name" content="Swift社区">
<meta property="og:description" content="前言本期是 Swift 编辑组自主整理周报的第八期，每个模块已初步成型。各位读者如果有好的提议，欢迎在文末留言。 欢迎投稿或推荐内容。目前计划每两周周一发布，欢迎志同道合的朋友一起加入周报整理。 风起雨坠袭大地，叶落冬来又一年。Swift社区，和你同风雨，与你共未来！👊👊👊  周报精选 新闻和社区：苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。 提案：">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f24c1898773749e790a319f674361501~tplv-k3u1fbpfcp-watermark.image?">
<meta property="og:updated_time" content="2022-11-14T07:54:53.009Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Swift 周报 第十七期">
<meta name="twitter:description" content="前言本期是 Swift 编辑组自主整理周报的第八期，每个模块已初步成型。各位读者如果有好的提议，欢迎在文末留言。 欢迎投稿或推荐内容。目前计划每两周周一发布，欢迎志同道合的朋友一起加入周报整理。 风起雨坠袭大地，叶落冬来又一年。Swift社区，和你同风雨，与你共未来！👊👊👊  周报精选 新闻和社区：苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。 提案：">
<meta name="twitter:image" content="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f24c1898773749e790a319f674361501~tplv-k3u1fbpfcp-watermark.image?">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://fanbaoying.github.io/Swift-周报-第十七期/"/>





  <title>Swift 周报 第十七期 | Swift社区</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    
    <a href="https://github.com/SwiftCommunityRes" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
    
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Swift社区</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">做最好的 Swift 社区</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://fanbaoying.github.io/Swift-周报-第十七期/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Swift社区">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://avatars.githubusercontent.com/u/84354365?v=4">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Swift社区">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Swift 周报 第十七期</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2022-11-14T15:53:09+08:00">
                2022-11-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Swift-周报/" itemprop="url" rel="index">
                    <span itemprop="name">Swift 周报</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                -->
                <span title="字数统计">
                  数字统计 2,326字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                --> 

                <span title="阅读时长">
                  阅读时长 9分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p><strong>本期是 Swift 编辑组自主整理周报的第八期</strong>，每个模块已初步成型。各位读者如果有好的提议，欢迎在文末留言。</p>
<p>欢迎投稿或推荐内容。目前计划每两周周一发布，欢迎志同道合的朋友一起加入周报整理。</p>
<p>风起雨坠袭大地，叶落冬来又一年。<strong>Swift社区</strong>，和你同风雨，与你共未来！👊👊👊</p>
<blockquote>
<p><strong>周报精选</strong></p>
<p>新闻和社区：苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。</p>
<p>提案：Swift 论坛讨论人气最高的提案</p>
<p>Swift 论坛：比较两个 “any Error” 的相等性</p>
<p>推荐博文：iOS 16 统计图实战汇总</p>
<p><strong>话题讨论：</strong> 大家觉得互联网行业会不会持续走下坡路？</p>
</blockquote>
<a id="more"></a>
<h2 id="新闻和社区"><a href="#新闻和社区" class="headerlink" title="新闻和社区"></a>新闻和社区</h2><h3 id="11-月-14-日，参与新一周的-Ask-Apple-活动"><a href="#11-月-14-日，参与新一周的-Ask-Apple-活动" class="headerlink" title="11 月 14 日，参与新一周的 Ask Apple 活动"></a>11 月 14 日，参与新一周的 Ask Apple 活动</h3><p><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f24c1898773749e790a319f674361501~tplv-k3u1fbpfcp-watermark.image?" alt=""></p>
<p>欢迎继续参与新一周激动人心的 Ask Apple 开发者系列活动，与 Apple 专家直接交流沟通。针对如何将最新技术集成到您的 App 中、设计直观的 UI，以及测试最新软件等主题大胆提问。</p>
<p>活动将于 11 月 14 日至 18 日举行，届时将提供多种语言和多个时区的在线一对一咨询和小组 Q&amp;A。现已面向 Apple Developer Program 和 Apple Developer Enterprise Program 的当前成员开放注册。</p>
<p>Ask Apple 开发者系列活动终场周将在 12 月推出，敬请关注详情。</p>
<h3 id="苹果发布最新声明！将工人健康放在首位，iPhone-14-Pro-收获需等待更长时间。"><a href="#苹果发布最新声明！将工人健康放在首位，iPhone-14-Pro-收获需等待更长时间。" class="headerlink" title="苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。"></a>苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。</h3><p>11 月 7 日，苹果对 iPhone 14 Pro 和 iPhone 14 Pro Max 目前的供应情况做出最新声明。苹果称，富士康郑州工厂目前的产能大幅度降低，iPhone 14 Pro 和 iPhone 14 Pro Max 的出货量将低于预期。</p>
<p>苹果表示，“我们继续看到对 iPhone 14 Pro 和 iPhone 14 Pro Max 机型的强劲需求。然而，我们现在预计 iPhone 14 Pro 和 iPhone 14 Pro Max 的出货量将低于我们之前的预期，顾客将需要等待更长的时间才能收到新产品。”</p>
<p>苹果称，正在与供应商密切合作，以恢复正常的生产水平，同时确保每个工人的健康和安全。</p>
<h3 id="macOS-Ventura-更高效，更尽兴，更跨界。"><a href="#macOS-Ventura-更高效，更尽兴，更跨界。" class="headerlink" title="macOS Ventura 更高效，更尽兴，更跨界。"></a>macOS Ventura 更高效，更尽兴，更跨界。</h3><p>macOS Ventura 让各种日常操作都进化成神操作。一波新技能助你搞定更多，一众常用 app 能分享和协作，晋级的游戏让你更投入，还有种种妙招能拉上其他设备一起显身手。</p>
<p>优化的搜索功能，搜索功能可提供更准确、更完整的搜寻结果，还能在你键入前就提供搜索建议。</p>
<p>聚焦的快速操作，现在，你可使用聚焦搜索快速执行操作，比如设置闹钟、开启专注模式、用 Shazam 查找歌名、运行快捷指令等。</p>
<p>共享标签页组，从 Safari 浏览器直接分享标签页和书签，或发送信息。无论是与好友规划行程，还是与家人选购沙发，你都可以在一处地方集中分享所有标签页。而你的伙伴也可把他们的标签页添加进来。</p>
<p>收发信息的新技能，现在，你可对刚发出的信息进行编辑，或是将其撤回。另外，对于无法及时回复，想回头再来处理的信息，可标为未读。</p>
<p>iCloud 共享照片图库，可与最多五人顺畅地分享照片和视频，鼓励大家一起制作家庭照片集，让回忆更丰富完整。iCloud 共享照片图库会把家人们的美好回忆都集于一处，让每个家庭成员随时都能欣赏，即使不是自己拍摄或编辑的照片也能看到。</p>
<p>多种智能的共享方式，共享照片图库可以根据开始日期或照片中的人物，选取想要囊括的内容来进行设置。完成后，你可以手动分享，也可以看看边栏里新的“为共享图库推荐”，根据它的智能建议将照片添加进来。</p>
<p>在 App 之间切换，轻点一下，可在各 app 和窗口之间流畅切换；点按桌面任意位置，则能快速返回某个文件或文件夹。</p>
<p>FaceTime 通话也能玩接力了，轻轻一点，就能在设备之间转移 FaceTime 通话，方便你随时换上合适的设备。</p>
<p>让 iPhone 兼职网络摄像头，iPhone 强大的摄像头系统配合 Mac，能实现以往普通网络摄像头做不到的效果。只要将 iPhone 靠近 Mac，输入源就会自动切换为 iPhone，而且过程是无线的，不用动手插拔。</p>
<p>更多 macOS Ventura 新功能请查阅 <a href="https://www.apple.com.cn/macos/ventura/" target="_blank" rel="noopener">https://www.apple.com.cn/macos/ventura/</a></p>
<h2 id="提案"><a href="#提案" class="headerlink" title="提案"></a>提案</h2><p>提案模块本期没有新的状态更新。下面推荐几个在 <strong>Swift 论坛讨论人气最高</strong>的往期提案。感兴趣的小伙伴可以去参与讨论。</p>
<p>提案 SE-0374: <a href="https://forums.swift.org/t/se-0374-add-sleep-for-to-clock/60787/19" title="SE-0374" target="_blank" rel="noopener">将 sleep(for:) 添加到 Clock</a>。该提案已在<a href="https://mp.weixin.qq.com/s/x-ufc5MauRGfoY571WePFA" target="_blank" rel="noopener">十五期周报</a>正在审查的提案模块做了详细介绍。</p>
<p>提案 SE-0376: <a href="https://forums.swift.org/t/se-0376-function-back-deployment/61015/16" title="SE-0376" target="_blank" rel="noopener">函数反向部署</a>。该提案已在<a href="https://mp.weixin.qq.com/s/_igJkQdGWEGSfbDmVL9bbg" target="_blank" rel="noopener">十六期周报</a>正在审查的提案模块做了详细介绍。</p>
<p>提案 SE-0377: <a href="https://forums.swift.org/t/se-0377-borrow-and-take-parameter-ownership-modifiers/61020/14" title="SE-0377" target="_blank" rel="noopener">提出了新的 borrow 和 take 参数修饰符</a>。该提案已在<a href="https://mp.weixin.qq.com/s/_igJkQdGWEGSfbDmVL9bbg" target="_blank" rel="noopener">十六期周报</a>正在审查的提案模块做了详细介绍。</p>
<p>提案 SE-0366: <a href="https://forums.swift.org/t/se-0366-second-review-take-operator-to-end-the-lifetime-of-a-variable-binding/61021/14" title="SE-0366" target="_blank" rel="noopener">代码上下文新增敏感关键字 move 修订后</a>。该提案已在<a href="https://mp.weixin.qq.com/s/i5a-jhRRdf36KUNRoMX_8w" target="_blank" rel="noopener">十一期周报</a>正在审查的提案模块做了详细介绍。</p>
<h2 id="Swift论坛"><a href="#Swift论坛" class="headerlink" title="Swift论坛"></a>Swift论坛</h2><p>1) <a href="https://forums.swift.org/t/an-informal-introduction-to-move-only-types/61358" title="Move-Only 类型的非正式介绍" target="_blank" rel="noopener">Move-Only 类型的非正式介绍</a></p>
<p>2) <a href="https://forums.swift.org/t/same-values-equality-complexity-guarantees/61334" title="相同的值相等的复杂性保证" target="_blank" rel="noopener">相同的值相等的复杂性保证</a></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> foo: <span class="type">String</span> = ....</span><br><span class="line"><span class="keyword">let</span> bar = foo</span><br><span class="line">foo == bar <span class="comment">// is this O(1) ?</span></span><br></pre></td></tr></table></figure>
<p>3) 资料分享 <a href="https://forums.swift.org/t/signal-handling-in-swift/61351" title="swift package SignalHandler" target="_blank" rel="noopener">swift package SignalHandler</a></p>
<p>4) 讨论<a href="https://forums.swift.org/t/issues-with-using-5-7-regex-on-linux/61344" title="在 Linux 上使用 5.7 Regex 的问题" target="_blank" rel="noopener">在 Linux 上使用 5.7 <code>Regex</code> 的问题</a></p>
<p>5) 讨论 <a href="https://forums.swift.org/t/an-ios-app-for-the-swift-forum/61335/1" title="Swift 论坛的 iOS 应用" target="_blank" rel="noopener">Swift 论坛的 iOS 应用</a></p>
<p>Discourse Hub App可以用来浏览Swift论坛内容，App基于WebView，本质与用浏览器没有区别😂</p>
<p>6) 讨论<a href="https://forums.swift.org/t/detect-the-number-of-usb-ports-available-on-the-mac-device/61321" title="检测 Mac 设备上可用的 USB 端口数量" target="_blank" rel="noopener">检测 Mac 设备上可用的 USB 端口数量</a></p>
<p>7) 讨论<a href="https://forums.swift.org/t/comparing-two-any-error-s-for-equality/61338" title="比较两个“any Error”的相等性" target="_blank" rel="noopener">比较两个“any Error”的相等性</a></p>
<p>问题描述：有一个错误类型，它包含另一个存在的any Error：</p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">@frozen <span class="keyword">public</span></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">RecursiveError</span>&lt;<span class="title">Location</span>&gt;:<span class="title">Error</span></span></span><br><span class="line"><span class="class"></span>&#123;</span><br><span class="line">    <span class="comment">/// The location (key or index) where the error occurred.</span></span><br><span class="line">    <span class="keyword">public</span></span><br><span class="line">    <span class="keyword">let</span> location:<span class="type">Location</span></span><br><span class="line">    <span class="comment">/// The underlying error that occurred.</span></span><br><span class="line">    <span class="keyword">public</span></span><br><span class="line">    <span class="keyword">let</span> error:any <span class="type">Error</span></span><br><span class="line"></span><br><span class="line">    @inlinable <span class="keyword">public</span></span><br><span class="line">    <span class="keyword">init</span>(<span class="number">_</span> error:any <span class="type">Error</span>, <span class="keyword">in</span> location:<span class="type">Location</span>)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="keyword">self</span>.location = location</span><br><span class="line">        <span class="keyword">self</span>.error = error</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>Unit Test:</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$<span class="number">0</span>.test(name: <span class="string">"int32-to-uint8"</span>, decoding: bson,</span><br><span class="line">    failure: <span class="type">RecursiveError</span>&lt;<span class="type">String</span>&gt;.<span class="keyword">init</span>(</span><br><span class="line">        <span class="type">IntegerOverflowError</span>&lt;<span class="type">UInt8</span>&gt;.int32(.<span class="built_in">max</span>),</span><br><span class="line">        <span class="keyword">in</span>: <span class="string">"int32"</span>))</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">try</span> $<span class="number">0</span>[<span class="string">"int32"</span>].decode(to: <span class="type">UInt8</span>.<span class="keyword">self</span>)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>解决方法：</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">extension</span> <span class="title">Error</span> <span class="title">where</span> <span class="title">Self</span>:<span class="title">Equatable</span></span></span><br><span class="line"><span class="class"></span>&#123;</span><br><span class="line">    <span class="keyword">fileprivate</span></span><br><span class="line">    <span class="function"><span class="keyword">func</span> <span class="title">equals</span><span class="params">(<span class="number">_</span> other:any Error)</span></span> -&gt; <span class="type">Bool</span></span><br><span class="line">    &#123;</span><br><span class="line">        (other <span class="keyword">as</span>? <span class="type">Self</span>).<span class="built_in">map</span> &#123; $<span class="number">0</span> == <span class="keyword">self</span> &#125; ?? <span class="literal">false</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>8) 讨论 <a href="https://forums.swift.org/t/boolean-operators-and-async-let/61354" title="Boolean 运算和 async let" target="_blank" rel="noopener">Boolean 运算和 <code>async let</code></a></p>
<p><strong>执行：</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">async <span class="keyword">let</span> first: <span class="type">Int</span>[] = someAsyncCall()</span><br><span class="line">async <span class="keyword">let</span> second: <span class="type">Int</span>[] = anotherAsyncCall()</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> bothEmpty = (await first).isEmpty &amp;&amp; (await second).isEmpty</span><br><span class="line"><span class="comment">// or</span></span><br><span class="line"><span class="keyword">let</span> bothEmpty = await (first.isEmpty &amp;&amp; second.isEmpty)</span><br><span class="line"><span class="comment">// or any other variation I can think of</span></span><br></pre></td></tr></table></figure>
<p><strong>会有以下 Error：</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&apos;async let&apos; in an autoclosure that does not support concurrency</span><br><span class="line">Capturing &apos;async let&apos; variables is not supported</span><br></pre></td></tr></table></figure>
<p>Boolean 运算是使用标记为自动闭包的 rhs 参数定义的，这意味着右侧的表达式会自动捆绑到闭包中，从而延迟其执行直到需要。 值得注意的是，这个 rhs 闭包属性没有被标记为 async ，所以没有 await 语句可以出现在它的“内部”。</p>
<p><strong>解决：</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> bothEmpty = await [first, second].allSatisfy(\.isEmpty)</span><br></pre></td></tr></table></figure>
<h2 id="推荐博文"><a href="#推荐博文" class="headerlink" title="推荐博文"></a>推荐博文</h2><p><a href="https://github.com/SwiftCommunityRes/article-ios/blob/main/resource/16+在iOS16中用SwiftUI图表定制一个线图.md" title="在 iOS16中用SwiftUI图表定制一个线图" target="_blank" rel="noopener">在 iOS16 中用 SwiftUI 图表定制一个线图</a></p>
<p><strong>摘要：</strong> 在 iOS 16 中引入的 SwiftUI 图表，可以以直观的视觉格式呈现数据，并且可以使用 SwiftUI 图表快速创建。本文演示了几种定制折线图并与区域图结合来展示数据的方法。</p>
<p><a href="https://github.com/SwiftCommunityRes/article-ios/blob/main/resource/10%20在%20Swift图表中使用Foudation库中的测量类型.md" target="_blank" rel="noopener">在 Swift 图表中使用 Foudation 库中的测量类型</a></p>
<p><strong>摘要：</strong> 本篇文章使用今年推出的新的 Swift Charts 框架，实现如何绘制默认不符合 Plottable 协议的类型的数据。</p>
<p><a href="https://github.com/SwiftCommunityRes/article-ios/blob/main/resource/15%20在iOS%2016中用SwiftUI%20Charts创建一个折线图%20.md" target="_blank" rel="noopener">在 iOS 16 中用 SwiftUI Charts 创建一个折线图</a></p>
<p><strong>摘要：</strong> 苹果在 WWWDC 2022 上推出了 SwiftUI 图表，本文展示了如何用比以前从头开始创建同样的折线图少得多的代码轻松创建折线图。</p>
<p><a href="https://github.com/SwiftCommunityRes/article-ios/blob/main/resource/13%20如何在SwiftUI中创建条形图.md" target="_blank" rel="noopener">如何在 SwiftUI 中创建条形图</a></p>
<p><strong>摘要：</strong> 本文将展示如何创建一个垂直条形图，其中矩形的高度将代表每个类别的值。</p>
<p><a href="https://github.com/SwiftCommunityRes/article-ios#8" title="Flutter 实战" target="_blank" rel="noopener">Flutter 实战整理</a></p>
<p><strong>摘要：</strong> 文章仓库增加 Flutter 实战模块，整理相关主题文章。</p>
<h2 id="话题讨论"><a href="#话题讨论" class="headerlink" title="话题讨论"></a>话题讨论</h2><p><strong>都说互联网红利已经没有了，那么大家觉得互联网行业会不会持续走下坡路？</strong></p>
<p>欢迎在文末留言参与讨论。</p>
<h2 id="关于我们"><a href="#关于我们" class="headerlink" title="关于我们"></a>关于我们</h2><p><strong>Swift社区</strong>是由 Swift 爱好者共同维护的公益组织，我们会分享以 <strong>Swift实战</strong>、<strong>SwiftUl</strong>、<strong>Swift基础</strong>为核心的技术内容，也整理收集优秀的学习资料。</p>
<p>特别感谢 Swift社区 编辑部的每一位编辑，感谢大家的辛苦付出，为 Swift社区 提供优质内容，为 Swift 语言的发展贡献自己的力量。</p>

      
    </div>
    
    
    
    

    
      <div>
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      </div>
    


    
      <div>
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/Swift-周报-第十七期/">Swift 周报 第十七期</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 Swift社区 的个人博客">Swift社区</a></p>
  <p><span>发布时间:</span>2022年11月14日 - 15:11</p>
  <p><span>最后更新:</span>2022年11月14日 - 15:11</p>
  <p><span>原始链接:</span><a href="/Swift-周报-第十七期/" title="Swift 周报 第十七期">https://fanbaoying.github.io/Swift-周报-第十七期/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://fanbaoying.github.io/Swift-周报-第十七期/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
      $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
        });
    });  
</script>

      </div>
    


    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechat.png" alt="Swift社区 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.png" alt="Swift社区 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Swift/" rel="tag"><i class="fa fa-tag"></i> Swift</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Swift-周报-第十六期/" rel="next" title="Swift 周报 第十六期">
                <i class="fa fa-chevron-left"></i> Swift 周报 第十六期
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Swift-周报-第十八期/" rel="prev" title="Swift 周报 第十八期">
                Swift 周报 第十八期 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="https://avatars.githubusercontent.com/u/84354365?v=4"
                alt="Swift社区" />
            
              <p class="site-author-name" itemprop="name">Swift社区</p>
              <p class="site-description motion-element" itemprop="description">我们的使命是做一个最专业最权威的 Swift 中文社区，我们的愿景是希望更多的人学习和使用Swift。我们会分享以 Swift 实战、SwiftUI、Swift 基础为核心的技术干货，不忘初心，牢记使命。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">187</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">19</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">11</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_36478920" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/5a30d987f265da430d580126" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-spinner"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/fanbaoying" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/swift-community" target="_blank" title="知乎">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>知乎</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/7711465033" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzAxNzgzNTgwMw==&action=getalbum&album_id=2024314764775981057" target="_blank" title="公众号">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>公众号</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftWeekly" title="SwiftWeekly" target="_blank">SwiftWeekly</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/article-ios" title="Article-ios" target="_blank">Article-ios</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftUI-Book" title="SwiftUI-Book" target="_blank">SwiftUI-Book</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#新闻和社区"><span class="nav-number">2.</span> <span class="nav-text">新闻和社区</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#11-月-14-日，参与新一周的-Ask-Apple-活动"><span class="nav-number">2.1.</span> <span class="nav-text">11 月 14 日，参与新一周的 Ask Apple 活动</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#苹果发布最新声明！将工人健康放在首位，iPhone-14-Pro-收获需等待更长时间。"><span class="nav-number">2.2.</span> <span class="nav-text">苹果发布最新声明！将工人健康放在首位，iPhone 14 Pro 收获需等待更长时间。</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#macOS-Ventura-更高效，更尽兴，更跨界。"><span class="nav-number">2.3.</span> <span class="nav-text">macOS Ventura 更高效，更尽兴，更跨界。</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#提案"><span class="nav-number">3.</span> <span class="nav-text">提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Swift论坛"><span class="nav-number">4.</span> <span class="nav-text">Swift论坛</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#推荐博文"><span class="nav-number">5.</span> <span class="nav-text">推荐博文</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#话题讨论"><span class="nav-number">6.</span> <span class="nav-text">话题讨论</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关于我们"><span class="nav-number">7.</span> <span class="nav-text">关于我们</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Swift社区</span>

  
</div>

<!-- 
<div class="powered-by">
  <i class="fa fa-user-md">
  </i>
  <span id="busuanzi_container_site_uv">
    已有<span id="busuanzi_value_site_uv"></span>人来访
  </span>

</div>


  <span class="post-meta-divider">|</span>


<div class="powered-by">
  <i class="fa fa-eye"></i>
  <span id="busuanzi_container_site_pv">
      访问量<span id="busuanzi_value_site_pv"></span>次
  </span>
</div>



  <span class="post-meta-divider">|</span>


-->

<div class="theme-info">
  <i class="fa fa-pencil"></i>
  <span class="post-count">博客全站共361.6k字</span>
</div>


<!-- 
  <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>



-->

        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
